import { http } from '@/utils/http'

/**
 * 首页需求
 * @returns Promise<IResData<INeedData[]>>
 */
export function getNeedFirstPage(): Promise<IResData<INeedData[]>> {
  return http.get('/api/nongshang/service')
}

/**
 * 需求报送
 * @param params
 * @returns Promise<IResData<any>>
 */
export function needSubmit(params: INeedParams): Promise<IResData<any>> {
  return http.post('/api/nongshang/service_submit', params, params)
}

/**
 * 获取天气
 * @param city
 * @return Promise<IResData<any>>
 */
export function weather(city: string): Promise<IResData<any>> {
  return http.get(`/api/nongshang/weather`, { city })
}
